home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / TCP_IP / TNOS230S / ENET.H < prev    next >
C/C++ Source or Header  |  1997-07-30  |  1KB  |  53 lines

  1. #ifndef    _ENET_H
  2. #define _ENET_H
  3.  
  4. /* Generic Ethernet constants and templates */
  5. #ifndef    _GLOBAL_H
  6. #include "global.h"
  7. #endif
  8.  
  9. #ifndef    _MBUF_H
  10. #include "mbuf.h"
  11. #endif
  12.  
  13. #ifndef    _IFACE_H
  14. #include "iface.h"
  15. #endif
  16.  
  17. #define    EADDR_LEN    6
  18. /* Format of an Ethernet header */
  19. struct ether {
  20.     uint8 dest[EADDR_LEN];
  21.     uint8 source[EADDR_LEN];
  22.     uint type;
  23. };
  24. #define    ETHERLEN    14
  25.  
  26. /* Ethernet broadcast address */
  27. extern unsigned char Ether_bdcst[];
  28.  
  29. /* Ethernet type fields */
  30. #define    IP_TYPE        0x800    /* Type field for IP */
  31. #define    ARP_TYPE    0x806    /* Type field for ARP */
  32. #ifndef REVARP_TYPE
  33. #define    REVARP_TYPE    0x8035    /* Type field for reverse ARP */
  34. #endif
  35.  
  36. #define    RUNT        60    /* smallest legal size packet, no fcs */
  37. #define    GIANT        1514    /* largest legal size packet, no fcs */
  38.  
  39. #define    MAXTRIES    16    /* Maximum number of transmission attempts */
  40.  
  41. /* In file enet.c: */
  42. char *pether(char *out,char *addr);
  43. int gether(char *out,const char *cp);
  44. int enet_send(struct mbuf *bpp,struct iface *iface,uint32 gateway,int prec,int del,int tput,int rel);
  45. int enet_output(struct iface *iface,const char *dest,char *source,int16 type,
  46.     struct mbuf *data);
  47. void eproc(struct iface *iface,struct mbuf *bp);
  48.  
  49. /* In enethdr.c: */
  50. int ntohether(struct ether *ether,struct mbuf **bpp);
  51.  
  52. #endif    /* _ENET_H */
  53.